﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MefWallpaperAddin
{
    public static class EnvironmentSupport
    {
        private static Version WINDOWS_7_VERSION;
        private static OperatingSystem os = null;

        static EnvironmentSupport()
        {
            WINDOWS_7_VERSION = new Version(6, 1);
            os = Environment.OSVersion;
        }

        public static bool MeetsOrExceeds(PlatformVersion platformVersion)
        {
            if (os.Platform != platformVersion.PlatformID || os.Version < platformVersion.Version)
                return false;
            else
                return true;
        }
    }

    public class PlatformVersion
    {
        public static PlatformVersion WINDOWS_7 = new PlatformVersion(PlatformID.Win32NT, new Version(6, 1));

        public Version Version
        { get; private set; }

        public PlatformID PlatformID
        { get; private set; }

        public PlatformVersion(PlatformID platform, Version version)
        {
            this.PlatformID = platform;
            this.Version = version;
        }
    }
}
